//
//  NewsViewController.m
//  PosApp
//
//  Created by 李英新 on 2018/10/12.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "NewsViewController.h"
#import "NewsViewCell.h"

@interface NewsViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *NewsTable;

@end

@implementation NewsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"消息通知";
    self.NewsTable.delegate = self;
    self.NewsTable.dataSource = self;
    self.NewsTable.rowHeight = 130;
    self.NewsTable.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.NewsTable registerNib:[UINib nibWithNibName:@"NewsViewCell" bundle:nil] forCellReuseIdentifier:@"cell"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NewsViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[NewsViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    
    if (indexPath.row%2==0) {
        cell.TypeLabel.backgroundColor = KRGBColor(227, 49, 13);
    }else{
        cell.TypeLabel.backgroundColor = KRGBColor(196, 196, 196);
    }
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
